package com.kfm.pm.ginshin;

import java.util.Objects;

public class Role {
    private String name;
    private String attr;
    private int star;
    private int orderSeat;
    private int level;

    public Role() {}

    public Role(String name, String attr, int star, int orderSeat, int level) {
        this.name = name;
        this.attr = attr;
        this.star = star;
        this.orderSeat = orderSeat;
        this.level = level;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAttr() {
        return attr;
    }

    public void setAttr(String attr) {
        this.attr = attr;
    }

    public int getStar() {
        return star;
    }

    public void setStar(int star) {
        this.star = star;
    }

    public int getOrderSeat() {
        return orderSeat;
    }

    public void setOrderSeat(int orderSeat) {
        this.orderSeat = orderSeat;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    @Override
    public String toString() {
        return "Role{" +
                "角色名：'" + name + '\'' +
                ", 属性：'" + attr + '\'' +
                ", 稀有度：" + star +
                ", 命座：" + orderSeat +
                ", 等级：Lv." + level +
                '}';
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        Role role = (Role) object;
        return star == role.star && orderSeat == role.orderSeat && level == role.level && Objects.equals(name, role.name) && Objects.equals(attr, role.attr);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, attr, star, orderSeat, level);
    }
}
